<?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
namespace Card\Model;
use Think\Model;
/**
 * Description of PictureShareModel
 *
 * @author 薛鹏
 */
class PictureShareModel extends Model {
    public function addPictureShare($data)
    {
        return M('picture_share')->add($data);
    }
    public function existPictureShare($sender_id, $receiver_id, $card_id, $type)
    {
        return M('picture_share')->where([
            'sender_id' => $sender_id,
            'receiver_id' => $receiver_id,
            'card_id' => $card_id,
            'type' => $type
        ])->getField('id');
    }
}
